package com.grandtech.insurance.dto.OnlineIns;

import java.io.Serializable;

/**
 * 四至坐标
 *
 * @author lijianpeng
 * @date 2020-05-06 09:53:39
 */
public class Szzb implements Serializable {

    private Double W;
    private Double S;
    private Double E;
    private Double N;

    public Double getW() {
        return W;
    }

    public void setW(Double w) {
        W = w;
    }

    public Double getS() {
        return S;
    }

    public void setS(Double s) {
        S = s;
    }

    public Double getE() {
        return E;
    }

    public void setE(Double e) {
        E = e;
    }

    public Double getN() {
        return N;
    }

    public void setN(Double n) {
        N = n;
    }

    public static Szzb refszzb(String szzb) {
        Szzb szzb1 = new Szzb();

        String[] res1 = szzb.split(";");
        for (int i = 0; i < res1.length; i++) {
            if(res1[i].split(":")[0].equals("W")){
                szzb1.setW(Double.valueOf(res1[i].split(":")[1]));
            }
            if(res1[i].split(":")[0].equals("S")){
                szzb1.setS(Double.valueOf(res1[i].split(":")[1]));
            }
            if(res1[i].split(":")[0].equals("E")){
                szzb1.setE(Double.valueOf(res1[i].split(":")[1]));
            }
            if(res1[i].split(":")[0].equals("N")){
                szzb1.setN(Double.valueOf(res1[i].split(":")[1]));
            }
        }
        return szzb1;
    }

//    public static void main(String[] args) {
//        String test = "W:115.225786;S:38.111198;E:115.226776;N:38.114382";
//        String[] res1 = test.split(";");
//        Szzb szzb=new Szzb();
//        for (int i = 0; i < res1.length; i++) {
//            if(res1[i].split(":")[0].equals("W")){
//                szzb.setW(Double.valueOf(res1[i].split(":")[1]));
//            }
//            if(res1[i].split(":")[0].equals("S")){
//                szzb.setS(Double.valueOf(res1[i].split(":")[1]));
//            }
//            if(res1[i].split(":")[0].equals("E")){
//                szzb.setE(Double.valueOf(res1[i].split(":")[1]));
//            }
//            if(res1[i].split(":")[0].equals("N")){
//                szzb.setN(Double.valueOf(res1[i].split(":")[1]));
//            }
//        }
//    }


}